package com.geekaca.d09;

import java.io.File;

public class TestDir2 {
    public static void main(String[] args) {
        File file = new File("F:\\Geeka\\lh\\JavaSE_Senior\\day09");
        String[] listFileNames = file.list();
//        for (int i = 0; i < listFileNames.length; i++) {
//            System.out.println(listFileNames[i]);
//        }

        File[] fileArr = file.listFiles();
        for (int i = 0; i < fileArr.length; i++) {
            File file1 = fileArr[i];
            System.out.print(file1.getName());
            System.out.println(file1.isFile()?"是文件":"");
            System.out.println(file1.isDirectory() ? "是文件夹" : "");
        }


    }
}
